

function getTotalDay(year,month){
    
    if(month==12){
        return 31;
    }
    var monStr=month>9?month:'0'+month;
    var dstr=year+'-'+monStr+'-'+'01'
    
    var d = new Date(dstr);
    

    var nextMonth=month+1;

    var dmonstr=nextMonth>9?nextMonth:'0'+nextMonth;
    nextdstr=year+'-'+dmonstr+'-'+'01'
    
    var dnext=new Date(nextdstr);
    

    var lastTime=dnext.getTime()-d.getTime();
    var totalDay=lastTime/(1000*60*60*24);
    
    return totalDay

}

function addEvent(element,eventName,listener) {
    if (element.addEventListener) {
        element.addEventListener(eventName, listener, false);
    }
    else if (element.attachEvent) {
        element.attachEvent('on' + eventName, listener);
    }
    else {
        element['on' + eventName] = listener;
    }
}


function $(select){
    return document.querySelector(select)
}

function $a(select){
    return document.querySelectorAll(select)
}


function delName(str1,str2){
    var strList=str1.split(' ');
    var index=strList.indexOf(str2);
    strList.splice(index,1);
    str1=strList.join(' ');
    return str1;

}

